package com.zxy.biz.hibimpl;

import com.zxy.biz.UsersBiz;
import com.zxy.dao.UsersDao;
import com.zxy.entity.Users;

public class UsersBizImpl implements UsersBiz {
	private UsersDao usersDao;

	public void setUsersDao(UsersDao usersDao) {
		this.usersDao = usersDao;
	}

	@Override
	public Users login(String name, String password) {
		if (name == null || "".equals(name) || password == null
				|| "".equals(password)) {
			return null;
		}
		Users user = usersDao.getByName(name);
		if (user != null) {
			if (password.equals(user.getPassword())) {
				return user;
			}
		}
		return null;
	}

}
